<template>
  <view class="box">
     <view class="t1">
		<image src="../../static/my/tz.png" class="t1_1" mode="widthFix"></image>
		<image src="../../static/my/scan.png" class="t1_2" mode="widthFix" @click="scanCodeClick"></image> 
		<image src="../../static/my/kf.png" class="t1_3" mode="widthFix"></image> 
	 </view>
	 <view class="b">
		<view class="b1">
			<image src="../../static/my/tx.png" style="width: 150rpx;" mode="widthFix"></image>
		</view> 
		<view class="b2">
			<view class="b3">
				刘海洋
			</view>
			<view class="b4">
				后勤工种·后勤岗位
			</view>
		</view>
		<view class="b5" @click="personHome">
			个人主页<image src="../../static/my/arrow.png" class="b6" mode="widthFix"></image>
		</view>
	 </view>
	 <view class="m">
		<view class="m1">
			<view class="m2">
				<view class="m3">
					7
				</view>
				<view class="m4">
					考评分
				</view>
			</view>
			<view class="m5"> 
				<image src="../../static/my/down.png" class="m6" mode="widthFix"></image>
			</view>
		</view> 
		<view class="m1">
			<view class="m2">
				<view class="m3">
					50
				</view>
				<view class="m4">
					考核分
				</view>
			</view>
			<view class="m5"> 
				<image src="../../static/my/down.png" class="m6" mode="widthFix"></image>
			</view>
		</view>
		<view class="m1">
			<view class="m2">
				<view class="m3">
					70
				</view>
				<view class="m4">
					积分
				</view>
			</view>
			<view class="m5"> 
				<image src="../../static/my/down.png" class="m6" mode="widthFix"></image>
			</view>
		</view>
		<view class="m1">
			<view class="m2">
				<view class="m3">
					88
				</view>
				<view class="m4">
					学分
				</view>
			</view>
			<view class="m5"> 
				<image src="../../static/my/up.png" class="m6" mode="widthFix"></image>
			</view>
		</view>
	 </view>
	 <view class="n">
		<view class="n1">
			<image src="../../static/my/a1.png" class="n2" mode="widthFix"></image>
			<view class="n3">
				安全通知
			</view>
			<view class="n4">
				强化安全意识
			</view>
		</view>
		<view class="n1">
			<image src="../../static/my/a2.png" class="n2" mode="widthFix"></image>
			<view class="n3">
				货柜管理
			</view>
			<view class="n4">
				把握商品数量
			</view>
		</view>  
	 </view>
	 <view class="l">
		<view class="l1">
			学习模块
		</view>
		<view class="l2">
			<view class="l3" @click="px">
				<view class="ll1">
					<image src="../../static/my/b1.png" class="ll2" mode="widthFix"></image>
				</view>
				<view class="ll3">
					培训记录
				</view>
			</view> 
			<view class="l3">
				<view class="ll1">
					<image src="../../static/my/b2.png" class="ll2" mode="widthFix"></image>
				</view>
				<view class="ll3">
					考试记录 
				</view>
			</view>
			<view class="l3" @click="practice">
				<view class="ll1">
					<image src="../../static/my/b3.png" class="ll2" mode="widthFix"></image>
				</view>
				<view class="ll3">
					练习记录
				</view>
			</view>
			<view class="l3">
				<view class="ll1">
					<image src="../../static/my/b4.png" class="ll2" mode="widthFix"></image>
				</view>
				<view class="ll3"> 
					学习记录
				</view>
			</view>
		</view>
		
	 </view>
	 <view class="o"> 
	 	<view class="o1">
			<view class="o2">
				<view class="o3">
					<image src="../../static/my/c1.png" class="o4" mode="widthFix"></image>
				</view>
				<view class="o5">
					积分商城 
				</view>
			</view>
			<view class="o2">
				<view class="o3">
					<image src="../../static/my/c2.png" class="o4" mode="widthFix"></image>
				</view>
				<view class="o5">
					已购课程 
				</view>
			</view>
			<view class="o2">
				<view class="o3">
					<image src="../../static/my/c3.png" class="o4" mode="widthFix"></image>
				</view>
				<view class="o5">
					错题本 
				</view>
			</view>
			<view class="o2">
				<view class="o3">
					<image src="../../static/my/c4.png" class="o4" mode="widthFix"></image>
				</view>
				<view class="o5">
					学分排行榜 
				</view>
			</view>
		</view>	 
	 </view>
	 <view class="o z"> 
		<image src="../../static/my/jf.png" class="z1" mode="widthFix"></image> 
		<view class="z2">
			<view class="z3">
				积分指南 
			</view>
			<view class="z4">
				提高工作积极性，激发创造性
			</view> 
		</view>
		<view class="z5">
			<view class="z6">
				去了解
			</view>
		</view>
	 </view>
	 <view class="p">
		<view class="p1">
			<view class="p2">
				我的团队<image src="../../static/my/arrow.png" style="width: 30rpx;" mode="widthFix"></image>
			</view>
			<view class="p3">
				提高团队素质，打造高效团队
			</view>
		</view>
		<image src="../../static/my/d1.png" class="p4" mode="widthFix"></image>
		<view class="p5">
			<view class="p6">
				<view class="p7">
					 <view class="p8">
						93
					 </view>
					 <view class="p9">
						考评分 
					 </view>
				</view>
				<view class="p10">
					<image src="../../static/my/up.png" class="p11" mode="widthFix"></image> 
				</view>
			</view>
			<view class="p6">
				<view class="p7">
					 <view class="p8">
						93
					 </view>
					 <view class="p9">
						考核分 
					 </view>
				</view>
				<view class="p10">
					<image src="../../static/my/up.png" class="p11" mode="widthFix"></image> 
				</view>
			</view>
			<view class="p6">
				<view class="p7">
					 <view class="p8">
						93
					 </view>
					 <view class="p9"> 
						学分 
					 </view>
				</view>
				<view class="p10">
					<image src="../../static/my/up.png" class="p11" mode="widthFix"></image> 
				</view>
			</view>
		</view>
		<view class="p12">
			<image src="../../static/my/ks.png" class="p13" mode="widthFix"></image>
			<view class="p14">
				考试
			</view>
			<image src="../../static/px/right.png" class="p15" mode="widthFix"></image>
		</view>
		<view class="p12">
			<image src="../../static/my/px.png" class="p13" mode="widthFix"></image>
			<view class="p14">
				培训
			</view>
			<image src="../../static/px/right.png" class="p15" mode="widthFix"></image>
		</view>
	 </view>
	 <view style="width: 100%;float: left;height: 110rpx;"></view>
  </view>
</template>

<script>
import {
		getInfo
	} from "@/common/api/login/login.js";
import { containerBuySuccess } from "@/common/api/huogui/huogui.js";
export default {
  data() {
    return {};
  },
  onLoad() {
  	this.getUserInfo()
  },
  methods: {
	// 扫码
	scanCodeClick() {
		uni.scanCode({
			onlyFromCamera: true,
			success: function (res) {
				if (res && res.result) {
					uni.showModal({
						title: "提示",
						content: "您确定要支付该商品吗？",
						success: function (result) {
							if (result.confirm) {
								console.log(res.result, "res.result");
								let arr = JSON.parse(res.result);
								arr = arr.split(",")
								console.log(arr, "arr");
								let params = {
									id: arr[0], // 货柜ID
									goodId: arr[1], // 商品ID
									goodName: arr[2], // 商品名称
									// goodNum: 1 || arr[3], // 商品数量
									goodNum: 1, // 商品数量
									consumePoints: arr[4], // 所需安全币
								}
								console.log(params, 'params');
								containerBuySuccess(params).then(res => {
									console.log(res, "res");
									if (res && res.code == 200 && res.data) {
										uni.showToast({
											title: "支付成功",
											icon: "none",
										});
									} else {
										uni.showToast({
											title: "支付失败",
											icon: "none",
										});
									}
								})
							} else if (result.cancel) {
								uni.showToast({
									title: "已取消支付",
									icon: "none",
								});
							}
						},
					});
				} else {
					uni.showToast({
						title: "扫码失败",
						icon: "none",
					});
				}
			},
			fail: function (err) {
				uni.showToast({
					title: "扫码失败",
					icon: "none",
				});
			},
		});
	},
	px(){
		uni.navigateTo({
			url: "/pages/training/px"
		})
	},
	practice(){
		uni.navigateTo({
			url: "/pages/training/practice"
		})
	},
	personHome() {
		uni.navigateTo({
			url: "/pages/personalInfo/personalInfo"
		})
	},
	getUserInfo() {
		getInfo().then((res) => {
			if (res && res.code == 200) {
				
			}
		});
	},			
  }
};
</script>

<style lang="scss">
	@import url("./my.scss");
	page{
		background-image: url("../../static/bg.png");
		background-size: 100% 150%;
	}
</style>
